package com.dfd.oauth2.resource.service.impl;

import com.dfd.oauth2.resource.domain.TbContent;
import com.dfd.oauth2.resource.mapper.TbContentMapper;
import com.dfd.oauth2.resource.service.TbContentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/*
 *文件名: TbContentServiceImpl
 *创建者: 东东
 *创建时间:2021/8/30 15:54
 *描述:
 */
@Service
public class TbContentServiceImpl implements TbContentService {

    @Autowired
    private TbContentMapper contentMapper;

    @Override
    public List<TbContent> selectAll() {
        return contentMapper.selectAll();
    }

    @Override
    public TbContent getById(Long id) {
        return contentMapper.selectByPrimaryKey(id);
    }

    @Override
    public int insert(TbContent tbContent) {
        return contentMapper.insertSelective(tbContent);
    }

    @Override
    public int update(TbContent tbContent) {
        return contentMapper.updateByPrimaryKey(tbContent);
    }

    @Override
    public int delete(Long id) {
        return contentMapper.deleteByPrimaryKey(id);
    }
}
